<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <img id="img" src="https://pic4.zhimg.com/70/v2-e2de7c6369576efd308712e9056c59d3.jpg" alt="">

    <script>
        var imgEle = document.getElementById('img');

        console.log(imgEle);
        // 方式一
        // imgEle.remove();

        // 方式二,兼容性更好
        imgEle.parentElement.removeChild(imgEle);

        var storage = {
            arrDom:[imgEle,imgEle.outerHTML]
        }

        console.log(storage);
        storage.arrDom[0] = null;

        setTimeout(() => {
            console.log(imgEle);
            
        },2000);

        imgEle = null;

    </script>
</body>
</html>